//
//  HomePageTableViewCell.m
//  UI礼物说
//
//  Created by dllo on 16/1/5.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "HomePageTableViewCell.h"

@implementation HomePageTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        
        
        self.image = [[UIImageView alloc] init];
        [self.contentView addSubview:self.image];
        self.title = [[UILabel alloc] init];
        [self.contentView addSubview:_title];
        
        self.imageXin = [[UIImageView alloc] init];
        [self.contentView addSubview:self.imageXin];
        
        self.view = [[UIView alloc] init];
        self.view.backgroundColor = [UIColor grayColor];
        [self.contentView addSubview:self.view];
        
        self.lable = [[UILabel alloc] init];
       
        [self.contentView addSubview:self.lable];
        
        self.button = [UIButton buttonWithType:UIButtonTypeCustom];

        [self.button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
        [self.contentView addSubview:_button];
        
    }
    return self;
}

- (void)buttonAction:(UIButton *)sender {
    NSLog(@"😄");
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.image.frame = CGRectMake(5, 0, self.frame.size.width - 10, 180);
    
    self.title.frame = CGRectMake(15, self.image.frame.size.height - 60, self.frame.size.width , 60);
    self.title.textColor = [UIColor whiteColor];
    self.title.numberOfLines = 0;
    self.title.font = [UIFont systemFontOfSize:17];
    self.imageXin.frame = CGRectMake(300,10, 40, 40);
    
    self.view.frame = CGRectMake(290, 0, 60,80);
    self.view.alpha = 0.5;
    self.view.layer.cornerRadius = 5;
    
    self.lable.frame = CGRectMake(295, 50, 60, 20);
    self.lable.textColor = [UIColor whiteColor];
    self.lable.textAlignment = UITextAlignmentCenter;
    self.button.frame = CGRectMake(290, 0, 60, 80);
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
